package com.example.deertrip;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class Moment_Detail_Activity extends AppCompatActivity {
    private Button good_btn;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_moment_detail);
        good_btn=findViewById(R.id.moment_good_button);

        show();
    }

    public void show(){
        TextView usernametv=findViewById(R.id.moment_name);
        TextView goodtv=findViewById(R.id.moment_good);
        TextView contenttv=findViewById(R.id.moment_content);
        ImageView imageView=findViewById(R.id.moment_image);

        Bundle bundle=getIntent().getExtras();
        if(bundle!=null){
            usernametv.setText((String)bundle.get("username"));
            Integer good=(Integer) bundle.get("good");
            goodtv.setText(good.toString());
            contenttv.setText((String)bundle.get("content"));

            byte[] in=getIntent().getByteArrayExtra("image");
            Bitmap bitmap= BitmapFactory.decodeByteArray(in,0,in.length);
            imageView.setImageBitmap(bitmap);
        }
    }



}
